package model.event;

/**
 * This class represents an AuctionEvent. An AuctionEvent occurs for example if
 * an auction started or ended.
 * 
 * @version 1.0 vom 12.11.2012
 * @author Distributed Group 111 1026312, 1026309
 */

public class AuctionEvent extends Event {

	private static final long serialVersionUID = 2210836284591553085L;
	private long auctionId;
	private int duration;

	public AuctionEvent(EventType type, long l) {
		super(type);
		this.auctionId = l;
	}
	public AuctionEvent(EventType type, long l, int duration) {
		this(type, l);
		this.duration = duration;
	}

	public long getAuctionId() {
		return this.auctionId;
	}
	public int getDuration() {
		return this.duration;
	}

	public String toString() {
		if (EventType.AUCTION_STARTED.equals(this.type))
			return super.toString() + "auction with id " + this.auctionId
					+ " created.";
		else if (EventType.AUCTION_ENDED.equals(this.type))
			return super.toString() + "auction with id " + this.auctionId
					+ " ended.";
		else
			return "";
	}
}